﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PresentationLayer.Reports;

namespace PresentationLayer.View.Reports
{
    public partial class Print_TrendByRequisition : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            int m1 = Convert.ToInt32(Request.QueryString["m1"].ToString());
            //string m2 = Request.QueryString["m2"].ToString();
            //string m3 = Request.QueryString["m3"].ToString();
            string cat = Request.QueryString["cat"].ToString();
            string dept = Request.QueryString["dept"].ToString();
            
            DS_Requisition ds = new DS_Requisition();
            PresentationLayer.Reports.DS_RequisitionTableAdapters.RequisitionTableAdapter ta = new PresentationLayer.Reports.DS_RequisitionTableAdapters.RequisitionTableAdapter();
           // ta.Fill(ds.Requisition,Convert.ToDecimal(m1),Convert.ToDecimal(m2),Convert.ToDecimal(m3),dept,cat);
            if (m1 == 01)
            {
                ta.FillByJan(ds.Requisition,dept,cat);
                PresentationLayer.Reports.Report_TrendAnalysisByRequisition req = new PresentationLayer.Reports.Report_TrendAnalysisByRequisition();
                req.SetDataSource(ds);
                CrystalReportViewer10.ReportSource = req;
            
            }
            if (m1 == 02)
            {
                ta.FillByFeb(ds.Requisition, dept, cat);
                PresentationLayer.Reports.Report_TrendAnalysisByRequisition req = new PresentationLayer.Reports.Report_TrendAnalysisByRequisition();
                req.SetDataSource(ds);
                CrystalReportViewer10.ReportSource = req;

            }
            else 
            {
                ta.FillByALL(ds.Requisition,m1, dept, cat);
                
                PresentationLayer.Reports.Report_TrendAnalysisByRequisition req = new PresentationLayer.Reports.Report_TrendAnalysisByRequisition();
                req.SetDataSource(ds);
                CrystalReportViewer10.ReportSource = req;
            
            }
        }
        }

        
    }
